﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LL.Data;

namespace LL.Business
{
    public class BusinessSessionFactory
    {
        public static BusinessSession NewSession(bool startTransaction = false)
        {
            var session = new BusinessSession()
            {
                //共享数据库连接
                DbSession = DbSessionFactory.NewSession(true)
            };
            if (startTransaction)
                session.BeginTranscation();
            return session;
        }
    }
}
